﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace TMSBackEnd.Migrations
{
    /// <inheritdoc />
    public partial class init : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Sys_user",
                columns: table => new
                {
                    Userid = table.Column<int>(name: "User_id", type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    Deptid = table.Column<long>(name: "Dept_id", type: "bigint", nullable: false),
                    Username = table.Column<string>(name: "User_name", type: "nvarchar(30)", maxLength: 30, nullable: false),
                    Nickname = table.Column<string>(name: "Nick_name", type: "nvarchar(30)", maxLength: 30, nullable: false),
                    Usertype = table.Column<string>(name: "User_type", type: "nvarchar(2)", maxLength: 2, nullable: true, defaultValue: "00"),
                    Email = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    Phonenumber = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    Sex = table.Column<string>(type: "char(1)", maxLength: 1, nullable: false, defaultValue: "0"),
                    Avatar = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
                    Password = table.Column<string>(type: "nvarchar(11)", maxLength: 11, nullable: true),
                    Status = table.Column<string>(type: "char(1)", maxLength: 1, nullable: false, defaultValue: "0"),
                    Delflag = table.Column<string>(name: "Del_flag", type: "char(1)", maxLength: 1, nullable: false, defaultValue: "0"),
                    Loginip = table.Column<string>(name: "Login_ip", type: "nvarchar(128)", maxLength: 128, nullable: true),
                    Logindate = table.Column<DateTime>(name: "Login_date", type: "datetime", nullable: false),
                    Createby = table.Column<string>(name: "Create_by", type: "nvarchar(64)", maxLength: 64, nullable: true),
                    Createtime = table.Column<DateTime>(name: "Create_time", type: "datetime", nullable: false),
                    Updateby = table.Column<string>(name: "Update_by", type: "nvarchar(64)", maxLength: 64, nullable: true),
                    Updatetime = table.Column<DateTime>(name: "Update_time", type: "datetime", nullable: false),
                    Remark = table.Column<string>(type: "nvarchar(500)", maxLength: 500, nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Sys_user", x => x.Userid);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Sys_user");
        }
    }
}
